package cn.walls1717.ggkt.vod.controller;


import cn.walls1717.ggkt.result.Result;
import cn.walls1717.ggkt.vod.service.VideoVisitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 视频来访者记录相关接口
 *
 * @author walls1717
 * @since 2022/07/16
 */
@Api(tags = "视频来访者记录相关接口")
@RestController
@RequestMapping("/admin/vod/videoVisitor")
public class VideoVisitorController {

    @Autowired
    private VideoVisitorService videoVisitorService;

    @ApiOperation("课程来访者统计")
    @GetMapping("findCount/{courseId}/{startDate}/{endDate}")
    public Result<Map<String, Object>> countVisitor(@PathVariable Long courseId,
                                                    @PathVariable String endDate,
                                                    @PathVariable String startDate) {
        Map<String, Object> map = videoVisitorService.countVisitor(courseId, startDate, endDate);
        return Result.success(map);
    }
}

